home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
gnu
/
libg_261.zip
/
libg_261
/
libg++
/
etc
/
graph
/
eGetOpt.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-28
|
562b
|
44 lines
#pragma implementation
#include "eGetOpt.h"
int
eGetOpt :: next_arg (int &i)
{
int tmp;
if (0 < sscanf (nargv[optind], "%d", &tmp))
{
i = tmp;
optind++;
return 1;
}
else
return 0;
}
int
eGetOpt :: next_arg (double &d)
{
double tmp;
if (0 < sscanf (nargv[optind], "%lf", &tmp))
{
d = tmp;
optind++;
return 1;
}
else
return 0;
}
int
eGetOpt :: next_arg (String &s)
{
if ('-' != nargv[optind][0])
{
s = nargv[optind];
optind++;
return 1;
}
else
return 0;
}